package com.katze.boot.quartz.domain;


import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.katze.boot.common.converter.DateTimeStringConverter;
import com.katze.boot.common.converter.JobLogStatus;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

@Data
@TableName("sys_job_log")
@ExcelIgnoreUnannotated
public class JobLog implements Serializable {
    @Serial
    private static final long serialVersionUID = -7114915445674333148L;

    // 任务执行成功
    public static final String JOB_SUCCESS = "1";
    // 任务执行失败
    public static final String JOB_FAIL = "0";

    @TableId(value = "LOG_ID", type = IdType.AUTO)
    private Long logId;

    private Long jobId;

    @ExcelProperty(value = "Bean名称")
    private String beanName;

    @ExcelProperty(value = "方法名称")
    private String methodName;

    @ExcelProperty(value = "方法参数")
    private String params;

    @ExcelProperty(value = "状态", converter = JobLogStatus.class)
    private String status;

    @ExcelProperty(value = "异常信息")
    private String error;

    @ExcelProperty(value = "耗时（毫秒）")
    private Long times;

    @ExcelProperty(value = "执行时间", converter = DateTimeStringConverter.class)
    private Date createTime;

    private transient String createTimeFrom;
    private transient String createTimeTo;

}
